/**
 * TODO: provide description with examples.
 *
 * @author Andrey Anisimov <hercules@inbox.ru>
 */

import core.util.validation.Validator;
import core.util.validation.ValidationError; 

class NonEmptyValidator extends Validator {

	/**
	 * @throws ValidationError The validation fails.
	 */
	this.validate = function() {
		if (0 == this.getTarget().getText().length) {
			throw new ValidationError(this, 'The field should not be empty.');
		}
	}
}